<template>
  <div class="containers">
       <x-textarea :max="20" placeholder="尽情吐槽吧" :height="250" class="text" v-model="content"></x-textarea>
       <div class="btn" @click="sub">提交</div>
       <toast v-model="show5" :time="500">{{toastText}}</toast>
  </div>
</template>
<script>
import { XTextarea ,Toast} from 'vux'
export default {
   components: {
    XTextarea,Toast
  },
  data () {
	    return {
            content:'',
            toastText:"提交成功",
            show5:false
        }
     },
  methods:{
      sub(){
          var self=this
          let data={
              userId:self.$route.query.userId,
              content:self.content
          }
           this.$axios.post('/device/feedback/add',data).then((res) => {
                self.show5=true;
                if(res.data.code!="1000"){
                     self.toastText="提交失败"
                 }
                 setTimeout(function(){
                    self.$router.push({ path: '/Personal', query: { userId: self.$route.query.userId }})
                 },600)
                
                
          })
      }
  }
}
</script>

<style lang="less" scoped>
  .containers{
      height: 100%;
      width: 100%;
      background: #f6f6f6;
      box-sizing: border-box;
      padding: 24px;
      .text{
          padding:20px 20px;
          font-size: 26px;
          background: #fff;
      }
      .btn{
          height: 75px;
          line-height: 75px;
          text-align: center;
          font-size:30px ;
          background: #feba4e;
          color: #fff;
          border-radius: 50px;
          width:586px;
          margin: 195px auto;
     }
  }
</style>
